package cn.school.mybatis.service;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import cn.school.mybatis.dao.AdminDao;
import cn.school.mybatis.dao.GradeDao;
import cn.school.mybatis.pojo.Admin;
import cn.school.mybatis.pojo.Grade;
import cn.school.mybatis.util.MyBatisUtil;

public class AdminService {
	public Admin login(String u, String p) {
		SqlSession s = MyBatisUtil.get();
		try {
			AdminDao dao = s.getMapper(AdminDao.class);
			return dao.login(u, p);
		} finally {
			MyBatisUtil.close(s);
		}
	}
}
